home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-04-02 | 20.3 KB | 740 lines | [TEXT/MPS ] |
- { UNothing.inc1.p}
- { Copyright © 1990, 1991 by Apple Computer, Inc. All rights reserved.}
-
- { Change List:
-
- ddmmyy
- GAP 070990 Eliminated unsafe use of an object field as a var or > 4 byte parameter
- error in TCGridView.DrawCell.
- GAP 070990 Eliminated unsafe use of an object field as a var or > 4 byte parameter
- error in TCIconTracker.CIconTrack>GetLocusFromScreen.
- GAP 070990 Eliminated unsafe use of an object field as a var or > 4 byte parameter
- error in TCIconTracker.CIconTrack>CopyToScreen.
- GAP 070990 Eliminated unsafe use of an object field as a var or > 4 byte parameter
- error in TComponentTracker.DoIt.
- GAP 070990 Eliminated unsafe use of an object field as a var or > 4 byte parameter
- error in TComponentTracker.UnDoIt.
- GAP 070990 Eliminated unsafe use of an object field as a var or > 4 byte parameter
- error in TComponentTracker.ReDoIt.
- GAP 081090 Changed TCIconTracker.ICIconTracker so the maxDepthGrafPort's portRect
- is the same as globRect and made sure the iconRect is within the bounds
- of the theMaxDevice^^.gdPMap^^.bounds. Quickdraw was being finicky and
- would crash when these invariants were violated.
- GAP 181290 Added more comments.
- GAP 191290 Cleaned up formatting removed "GAP" comments.
- GAP 191290 Added GetGrafEnv, SetOSGrafEnv, and SetGrafEnv calls in TCIconTracker.CIconTrack>>
- GetUnderNewIcon, so the graphics environment is properly set in the
- fUnderIcon OSImage.
- . GAP 110191 Added sense parameter to PlaceComponent methods to indicate whether this
- is a placement (TRUE) or an undo of a placement (FALSE).
- GAP 110190 TCGridView1.GetComponentTracker and TCGridView1.PlaceComponent
- are no longer overrides.
- GAP 110191 Changed PlaceComponent methods from FUNCTIONS to PROCEDURES.
- GAP 110191 Removed fOldComponentNumber instance variable from TComponentTracker
- and put it in TCGridView1. Modified IComponentTracker, ICGridView,
- DoIt, UnDoIt, RedoIt, and PlaceComponent methods accordingly.
- PlaceComponent methods accordingly.
- GAP 170191 Changed IComponentTracker to take a generic TView as its first argument
- as apposed to a TTrackingView.
- GAP 170191 Changed TComponentTracker.TrackMouse>>NextView to take a generic TView as
- its first argument as apposed to a TTrackingView and also return a generic
- TView.
- GAP 170191 Removed test for aView being a TTrackingView in TComponentTracker.TrackMouse>>
- NextView.
- GAP 180191 Added TCGridView2 class.
- GAP 180191 Removed argument from ICGridView1 and ICGridView2.
- GAP 180191 Added TCGridView2 to gDeadStripSuppression clause in ICGridApplication.
- GAP 180191 Altereed TCGridDocument.DoMakeViews so that the view created based on
- the gComponentPaletteFlag variable is either a TCGridView1 or a TCGridView2
- and not based on an argument passed to ICGridView1.
- GAP 180191 Modified TComponentTrackerMethods to work on both TCGridView1 and TCGridView2
- views.
- GAP 250191 Added a gApplication.InvalidateFocus to TComponentTracker.TrackMouse>>
- DesktopToLocal. This prevents focus errors when passing over debugging
- windows/views.
- GAP 250191 Removed references to, now obsolete, TOffscreenManager.Update.
- GAP 250191 Added new data type, ComponentPlacementSense, that is now the type
- of the sense paramater in PlaceComponent.
- GAP 280191 Added comments to TComponentTracker.TrackMouse and
- TComponentTracker.TrackMouse>>DesktopToLocal.
- GAP 280191 Added clauses in TComponentTracker.TrackMouse>>NextView depending
- on whether gApplication.WMgrToWindow returns NIL or not.
- GAP 310191 Added debugging code to TComponentTracker.DoIt.
- GAP 010291 Added additional clause in TComponentTracker.TrackMouse>>NextView
- so that an existing view contains the mouse point it will still
- recursively try to find an appropriate subview.
- GAP 010291 Added gApplication.Invalidate focus in TComponentTracker.TrackMouse>>
- DesktopToLocal before restoring desktopPort.
- GAP 130291 Put freeing of fMaxDepthGrafPort in TCIconTracker.Free after
- FreeIfObject(fUnderIcon) because fUnderIcon may depend on fMaxDepthGrafPort.
- GAP 190291 Changed TComponentTracker
- GAP 190291 Changed TComponentTracker.TrackMouse>>NextView to fix bug where icon may
- be dropped on palette underneath, if it was the window previously tracking.
- Added fTrackingWindow instance variable to TComponentTracker and modified
- IComponentTracker and Fields methods accordingly.
- GAP 190291 Changed TComponentTracker.TrackMouse>>NextView from a function to
- a procedure and eliminated the aTrackingView parameter. NextView now
- modifies fTrackingView and fTrackingWindow through side-effects.
- GAP 200291 Changed ClosePort to CloseCPort in TIconTracker.Free.
- GAP 020491 Massive changes for latest version using UIconDragging unit.
-
-
-
- End Change List. }
-
-
- { ::::::::::::::: TLooneyApplication :::::::::::::::: }
-
-
- {$S AInit}
- PROCEDURE TLooneyApplication.ILooneyApplication (itsMainFileType: OSType);
-
- VAR
- offscreenSize: Point;
-
- BEGIN {TLooneyApplication.ILooneyApplication}
-
- gLooneyPaletteFlag := TRUE;
-
- IApplication(itsMainFileType);
-
- IF gDeadStripSuppression THEN
- BEGIN
- IF Member(TObject(NIL), TLooneyView1) THEN
- IF Member(TObject(NIL), TLooneyView2) THEN
- END;
-
- END; {TLooneyApplication.ILooneyApplication}
-
-
- {$S AFields}
- PROCEDURE TLooneyApplication.Fields (PROCEDURE DoToField (fieldName: Str255;
- fieldAddr: Ptr;
- fieldType: INTEGER));
- OVERRIDE;
-
- BEGIN {TLooneyApplication.Fields}
- DoToField('TLooneyApplication', NIL, bClass);
- DoToField('gLooneyApplication', @gLooneyApplication, bObject);
- DoToField('gLooneyPaletteFlag', @gLooneyPaletteFlag, bBoolean);
- INHERITED Fields(DoToField);
- END;{TLooneyApplication.Fields}
-
-
- {$S AOpen}
- FUNCTION TLooneyApplication.DoMakeDocument (itsCmdNumber: cmdNumber): TDocument;
- OVERRIDE;
-
- VAR
- aLooneyDocument: TLooneyDocument;
-
- BEGIN {TLooneyApplication.DoMakeDocument}
- NEW(aLooneyDocument);
- FailNIL(aLooneyDocument);
- aLooneyDocument.ILooneyDocument;
- DoMakeDocument := aLooneyDocument;
- END; {TLooneyApplication.DoMakeDocument}
-
-
- { ::::::::::::: TLooneyDocument :::::::::::::: }
-
-
- {$S AOpen}
- PROCEDURE TLooneyDocument.ILooneyDocument;
-
- BEGIN {TLooneyDocument.ILooneyDocument}
- IDocument(kFileType, kSignature, kUsesDataFork, NOT kUsesRsrcFork, NOT kDataOpen, NOT kRsrcOpen);
- END; {TLooneyDocument.ILooneyDocument}
-
-
- {$S AFields}
- PROCEDURE TLooneyDocument.Fields (PROCEDURE DoToField (fieldName: Str255;
- fieldAddr: Ptr;
- fieldType: INTEGER));
- OVERRIDE;
-
- BEGIN {TLooneyDocument.Fields}
- DoToField('TLooneyDocument', NIL, bClass);
- INHERITED Fields(DoToField);
- END; {TLooneyDocument.Fields}
-
-
- {$S AOpen}
- PROCEDURE TLooneyDocument.DoMakeViews (forPrinting: BOOLEAN);
- OVERRIDE;
-
- VAR
- aWindow: TWindow;
- aPrintHandler: TStdPrintHandler;
- aLooneyView1: TLooneyView1;
- aLooneyView2: TLooneyView2;
-
- BEGIN {TLooneyDocument.DoMakeViews}
-
- New(aPrintHandler);
- FailNIL(aPrintHandler);
- IF gLooneyPaletteFlag THEN
- BEGIN
- aWindow := NewTemplateWindow(kLooneyWindow1ResID, SELF);
- aLooneyView1 := TLooneyView1(aWindow.FindSubView(kLooneyViewID));
- aLooneyView1.ILooneyView1;
- aPrintHandler.IStdPrintHandler(SELF,
- aLooneyView1,
- NOT kSquareDots,
- NOT kFixedSize,
- kFixedSize)
- END
- ELSE
- BEGIN
- aWindow := NewTemplateWindow(kLooneyWindow2ResID, SELF);
- aLooneyView2 := TLooneyView2(aWindow.FindSubView(kLooneyViewID));
- aLooneyView2.ILooneyView2;
- aPrintHandler.IStdPrintHandler(SELF,
- aLooneyView2,
- NOT kSquareDots,
- NOT kFixedSize,
- kFixedSize)
- END;
-
- gLooneyPaletteFlag := NOT gLooneyPaletteFlag; { Alternate between the two palettes. }
-
- END; {TLooneyDocument.DoMakeViews}
-
-
- { :::::::::::::: TLooneyView1 ::::::::::::::: }
-
-
- {$S AOpen}
- PROCEDURE TLooneyView1.ILooneyView1;
-
- VAR
- i: INTEGER;
-
- BEGIN {TLooneyView1.ILooneyView1}
-
- fOldLooneyNumber := 0;
- FOR i := 1 TO 10 DO
- SELF.fLooneyNumbers[i] := 0;
-
- { Palette #1 }
- fLooneyNumbers[1] := kDaffy1Icon;
- fLooneyNumbers[2] := kBugsIcon;
- fLooneyNumbers[3] := kSylvesterIcon;
- fLooneyNumbers[4] := kTweetyIcon;
- fLooneyNumbers[5] := kDaffy2Icon;
- fLooneyNumbers[6] := kDevilIcon;
- fLooneyNumbers[7] := kFogHornIcon;
-
- END; {TLooneyView1.ILooneyView1}
-
-
- {$S AFields}
- PROCEDURE TLooneyView1.Fields (PROCEDURE DoToField (fieldName: Str255;
- fieldAddr: Ptr;
- fieldType: INTEGER));
-
- VAR
- i: INTEGER;
- iString: Str255;
-
- BEGIN {TLooneyView1.Fields}
- DoToField('TLooneyView1', NIL, bClass);
- FOR i := 1 TO kMaxLooneys DO
- BEGIN
- NumToString(i, iString);
- DoToField(CONCAT('fLooneyNumbers', iString, ']'), @fLooneyNumbers[i], bInteger);
- END;
- INHERITED Fields(DoToField);
- END; {TLooneyView1.Fields}
-
-
- {$S ASelCommand}
- FUNCTION TLooneyView1.DoMouseCommand (VAR theMouse: Point;
- VAR info: EventInfo;
- VAR hysteresis: Point): TCommand;
- OVERRIDE;
-
- VAR
-
- aVPoint: VPoint;
- aCell: GridCell;
- offset: Point;
- aLooneyNumber: LooneyNumber;
-
- FUNCTION GetLooneyNumber (aCell: GridCell): INTEGER;
-
- VAR
- aLooneyIndex: INTEGER;
-
- BEGIN {GetLooneyNumber}
- aLooneyIndex := SELF.GetIndexFromCell(aCell);
- GetLooneyNumber := fLooneyNumbers[aLooneyIndex];
- END; {GetLooneyNumber}
-
- FUNCTION MouseDownOffset (aCell: GridCell): Point;
-
- VAR
-
- cellRect: VRect;
- offset: Point;
- width, height: LONGINT;
-
- BEGIN {MouseDownOffset}
- SELF.CellToVRect(aCell, cellRect);
- WITH cellRect DO
- BEGIN
- width := right - left;
- height := bottom - top;
- offset.h := (left + (width - kIconWidth) DIV 2) - aVPoint.h; { a negative value }
- offset.v := (top + (height - kIconHeight) DIV 2) - aVPoint.v; { a negative value }
- END;
- MouseDownOffset := offset
- END; {MouseDownOffset}
-
- BEGIN {TLooneyView1.DoMouseCommand}
- DoMouseCommand := gNoChanges;
- IF SELF.Focus THEN
- BEGIN
- SELF.QDToViewPt(theMouse, aVPoint);
- aCell := SELF.VPointToCell(aVPoint);
- aLooneyNumber := GetLooneyNumber(aCell);
- offset := MouseDownOffset(aCell);
- DoMouseCommand := SELF.GetLooneyPlacer(aLooneyNumber, offset)
- END
- END; {TLooneyView1.DoMouseCommand}
-
-
- {$S ARes}
- PROCEDURE TLooneyView1.DrawCell (aCell: GridCell; aQDRect: Rect);
-
- VAR
- bkgndColor, oldBkgndColor: RGBColor;
-
- BEGIN {TLooneyView1.DrawCell}
- INHERITED DrawCell(aCell, aQDRect); { Draw the relief surface }
-
- GetIfBkColor(oldBkgndColor); { Draw the new stuff "on top", preserving the back color }
- bkgndColor := fBkgndColor;
- SetIfBkColor(bkgndColor);
-
- SELF.PlotMyIcon(aCell, aQDRect);
- SELF.PlotMyText(aCell, aQDRect);
-
- SetIfBkColor(oldBkgndColor);
- END; {TLooneyView1.DrawCell}
-
-
- {$S ARes}
- PROCEDURE TLooneyView1.PlotMyIcon (aCell: GridCell; aQDRect: Rect);
-
- { Plot the icon within a cell. }
-
- VAR
-
- index: INTEGER;
- theLooney: Looney;
- theRect: Rect;
- shrinkH, shrinkV: INTEGER;
-
- BEGIN {TLooneyView1.PlotMyIcon}
- index := SELF.GetIndexFromCell(aCell);
- IF fLooneyNumbers[index] <> 0 THEN
- BEGIN
- theRect := aQDRect;
- shrinkH := (LengthRect(theRect, h) - kIconWidth) DIV 2;
- shrinkV := (LengthRect(theRect, v) - kIconHeight) DIV 2;
- InsetRect(theRect, shrinkH, shrinkV);
-
- theLooney := GetCIcon(fLooneyNumbers[index]);
- PlotCIcon(theRect, theLooney);
- DisposCIcon(theLooney)
- END
- END; {TLooneyView1.PlotMyIcon}
-
-
- {$S ARes}
- PROCEDURE TLooneyView1.PlotMyText (aCell: GridCell; aQDRect: Rect);
-
- { Plot the text within a cell. }
-
- BEGIN {TLooneyView1.PlotMyText}
- END; {TLooneyView1.PlotMyText}
-
-
- {$S ARes}
- FUNCTION TLooneyView1.GetIndexFromCell (aCell: GridCell): INTEGER;
-
- { Calculate the index of a LooneyNumber from it's cell. }
-
- BEGIN {TLooneyView1.GetIndexFromCell}
- GetIndexFromCell := aCell.h + kNumberOfColumns * (aCell.v - 1);
- END; {TLooneyView1.GetIndexFromCell}
-
-
- {$S ARes}
- FUNCTION TLooneyView1.GetLooneyPlacer (aLooneyNumber: LooneyNumber;
- offset: Point): TLooneyPlacer;
-
- { Get a new Looney tracker for this view. }
-
- VAR
- aLooneyPlacer: TLooneyPlacer;
-
- BEGIN {TLooneyView1.GetLooneyPlacer}
- NEW(aLooneyPlacer);
- FailNIL(aLooneyPlacer);
- aLooneyPlacer.ILooneyPlacer(SELF, offset, aLooneyNumber);
- GetLooneyPlacer := aLooneyPlacer
- END; {TLooneyView1.GetLooneyPlacer}
-
-
- {$S ARes}
- PROCEDURE TLooneyView1.PlaceLooney (aLooneyNumber: LooneyNumber;
- aVPoint: VPoint;
- sense: LooneyPlacementSense);
-
- { Place a Looney in the cell encompassed by aVPoint- in the cell's coordinate space. }
-
- VAR
- destCell: GridCell;
- index: INTEGER;
-
- BEGIN {TLooneyView1.PlaceLooney}
- IF SELF.Focus THEN
- BEGIN
- destCell := SELF.VPointToCell(aVPoint);
- IF ((destCell.h < 1) |
- (destCell.h > kNumberOfColumns)) |
- ((destCell.v > kNumberOfRows) |
- (destCell.v > kNumberOfRows)) THEN
- ProgramBreak('Problem In Placing Looney')
- ELSE
- BEGIN
- index := SELF.GetIndexFromCell(destCell);
- CASE sense OF
- placeIt, rePlaceIt :
- BEGIN
- fOldLooneyNumber := fLooneyNumbers[index];
- fLooneyNumbers[index] := aLooneyNumber
- END;
- unPlaceIt:
- fLooneyNumbers[index] := fOldLooneyNumber
- END; {CASE}
- SELF.InvalidateCell(destCell)
- END
- END
- END; {TLooneyView1.PlaceLooney}
-
-
- { :::::::::::::: TLooneyView2 ::::::::::::::: }
-
-
- {$S AOpen}
- PROCEDURE TLooneyView2.ILooneyView2;
-
- VAR
- i: INTEGER;
-
- BEGIN {TLooneyView2.ILooneyView2}
-
- fOldLooneyNumber := 0;
- FOR i := 1 TO 10 DO
- SELF.fLooneyNumbers[i] := 0;
-
- { Palette #2 }
- fLooneyNumbers[1] := kOscarIcon;
- fLooneyNumbers[2] := kHobbsIcon;
- fLooneyNumbers[3] := kCalvinIcon;
- fLooneyNumbers[4] := kYinYangIcon;
- fLooneyNumbers[5] := kMoofIcon
-
- END; {TLooneyView2.ILooneyView2}
-
-
- {$S AFields}
- PROCEDURE TLooneyView2.Fields (PROCEDURE DoToField (fieldName: Str255;
- fieldAddr: Ptr;
- fieldType: INTEGER));
-
- VAR
- i: INTEGER;
- iString: Str255;
-
- BEGIN {TLooneyView2.Fields}
- DoToField('TLooneyView2', NIL, bClass);
- FOR i := 1 TO kMaxLooneys DO
- BEGIN
- NumToString(i, iString);
- DoToField(CONCAT('fLooneyNumbers', iString, ']'), @fLooneyNumbers[i], bInteger);
- END;
- INHERITED Fields(DoToField);
- END; {TLooneyView2.Fields}
-
-
- {$S ASelCommand}
- FUNCTION TLooneyView2.DoMouseCommand (VAR theMouse: Point;
- VAR info: EventInfo;
- VAR hysteresis: Point): TCommand;
- OVERRIDE;
-
- VAR
-
- aVPoint: VPoint;
- aCell: GridCell;
- offset: Point;
- aLooneyNumber: LooneyNumber;
-
- FUNCTION GetLooneyNumber (aCell: GridCell): INTEGER;
-
- VAR
- aLooneyIndex: INTEGER;
-
- BEGIN {GetLooneyNumber}
- aLooneyIndex := SELF.GetIndexFromCell(aCell);
- GetLooneyNumber := fLooneyNumbers[aLooneyIndex];
- END; {GetLooneyNumber}
-
- FUNCTION MouseDownOffset (aCell: GridCell): Point;
-
- VAR
-
- cellRect: VRect;
- offset: Point;
- width, height: LONGINT;
-
- BEGIN {MouseDownOffset}
- SELF.CellToVRect(aCell, cellRect);
- WITH cellRect DO
- BEGIN
- width := right - left;
- height := bottom - top;
- offset.h := (left + (width - kIconWidth) DIV 2) - aVPoint.h; { a negative value }
- offset.v := (top + (height - kIconHeight) DIV 2) - aVPoint.v; { a negative value }
- END;
- MouseDownOffset := offset
- END; {MouseDownOffset}
-
- BEGIN {TLooneyView2.DoMouseCommand}
- DoMouseCommand := gNoChanges;
- IF SELF.Focus THEN
- BEGIN
- SELF.QDToViewPt(theMouse, aVPoint);
- aCell := SELF.VPointToCell(aVPoint);
- aLooneyNumber := GetLooneyNumber(aCell);
- offset := MouseDownOffset(aCell);
- DoMouseCommand := SELF.GetLooneyPlacer(aLooneyNumber, offset)
- END
- END; {TLooneyView2.DoMouseCommand}
-
-
- {$S ARes}
- PROCEDURE TLooneyView2.DrawCell (aCell: GridCell; aQDRect: Rect);
-
- VAR
- bkgndColor, oldBkgndColor: RGBColor;
-
- BEGIN {TLooneyView2.DrawCell}
- INHERITED DrawCell(aCell, aQDRect); { Draw the relief surface }
-
- GetIfBkColor(oldBkgndColor); { Draw the new stuff "on top", preserving the back color }
- bkgndColor := fBkgndColor;
- SetIfBkColor(bkgndColor);
-
- SELF.PlotMyIcon(aCell, aQDRect);
- SELF.PlotMyText(aCell, aQDRect);
-
- SetIfBkColor(oldBkgndColor);
- END; {TLooneyView2.DrawCell}
-
-
- {$S ARes}
- PROCEDURE TLooneyView2.PlotMyIcon (aCell: GridCell; aQDRect: Rect);
-
- { Plot the icon within a cell. }
-
- VAR
-
- index: INTEGER;
- theLooney: Looney;
- theRect: Rect;
- shrinkH, shrinkV: INTEGER;
-
- BEGIN {TLooneyView2.PlotMyIcon}
- index := SELF.GetIndexFromCell(aCell);
- IF fLooneyNumbers[index] <> 0 THEN
- BEGIN
- theRect := aQDRect;
- shrinkH := (LengthRect(theRect, h) - kIconWidth) DIV 2;
- shrinkV := (LengthRect(theRect, v) - kIconHeight) DIV 2;
- InsetRect(theRect, shrinkH, shrinkV);
-
- theLooney := GetCIcon(fLooneyNumbers[index]);
- PlotCIcon(theRect, theLooney);
- DisposCIcon(theLooney)
- END
- END; {TLooneyView2.PlotMyIcon}
-
-
- {$S ARes}
- PROCEDURE TLooneyView2.PlotMyText (aCell: GridCell; aQDRect: Rect);
-
- { Plot the text within a cell. }
-
- BEGIN {TLooneyView2.PlotMyText}
- END; {TLooneyView2.PlotMyText}
-
-
- {$S ARes}
- FUNCTION TLooneyView2.GetIndexFromCell (aCell: GridCell): INTEGER;
-
- { Calculate the index of a LooneyNumber from it's cell. }
-
- BEGIN {TLooneyView2.GetIndexFromCell}
- GetIndexFromCell := aCell.h + kNumberOfColumns * (aCell.v - 1);
- END; {TLooneyView2.GetIndexFromCell}
-
-
- {$S ARes}
- FUNCTION TLooneyView2.GetLooneyPlacer (aLooneyNumber: LooneyNumber;
- offset: Point): TLooneyPlacer;
-
- { Get a new Looney tracker for this view. }
-
- VAR
- aLooneyPlacer: TLooneyPlacer;
-
- BEGIN {TLooneyView2.GetLooneyPlacer}
- NEW(aLooneyPlacer);
- FailNIL(aLooneyPlacer);
- aLooneyPlacer.ILooneyPlacer(SELF, offset, aLooneyNumber);
- GetLooneyPlacer := aLooneyPlacer
- END; {TLooneyView2.GetLooneyPlacer}
-
-
- {$S ARes}
- PROCEDURE TLooneyView2.PlaceLooney (aLooneyNumber: LooneyNumber;
- aVPoint: VPoint;
- sense: LooneyPlacementSense);
-
- { Place a Looney in the cell encompassed by aVPoint- in the cell's coordinate space. }
-
- VAR
- destCell: GridCell;
- index: INTEGER;
-
- BEGIN {TLooneyView2.PlaceLooney}
- IF SELF.Focus THEN
- BEGIN
- destCell := SELF.VPointToCell(aVPoint);
- IF ((destCell.h < 1) | (destCell.h > kNumberOfColumns)) | ((destCell.v > kNumberOfRows) | (destCell.v > kNumberOfRows)) THEN
- ProgramBreak('Problem In Placing Looney')
- ELSE
- BEGIN
- index := SELF.GetIndexFromCell(destCell);
- CASE sense OF
- placeIt, rePlaceIt :
- BEGIN
- fOldLooneyNumber := fLooneyNumbers[index];
- fLooneyNumbers[index] := aLooneyNumber
- END;
- unPlaceIt:
- fLooneyNumbers[index] := fOldLooneyNumber
- END; {CASE}
- SELF.InvalidateCell(destCell)
- END
- END
- END; {TLooneyView2.PlaceLooney}
-
-
- { ::::::::::::: TLooneyPlacer ::::::::::::::: }
-
-
- {$S ASelCommand}
- PROCEDURE TLooneyPlacer.ILooneyPlacer (aTrackingView: TView;
- offset: Point;
- aLooneyNumber: LooneyNumber);
-
-
- BEGIN {TLooneyPlacer.ILooneyPlacer}
-
- SELF.IPlaceByNumber(aTrackingView, offset, aLooneyNumber);
- {??? fViewConstrain := FALSE ???}
-
- END; {TLooneyPlacer.ILooneyPlacer}
-
-
- {$S AFields}
- PROCEDURE TLooneyPlacer.Fields (PROCEDURE DoToField (fieldName: Str255;
- fieldAddr: Ptr;
- fieldType: INTEGER));
- OVERRIDE;
-
- BEGIN {TLooneyPlacer.Fields}
- DoToField('TLooneyPlacer', NIL, bClass);
- INHERITED Fields(DoToField);
- END; {TLooneyPlacer.Fields}
-
-
- { Actions }
-
- {$S ADoCommand}
- PROCEDURE TLooneyPlacer.DoIt;
- OVERRIDE;
-
- VAR
- releasePoint : VPoint;
-
-
- BEGIN {TLooneyPlacer.DoIt}
-
- INHERITED DoIt;
-
- releasePoint := fReleasePoint;
- IF MEMBER(fTrackingView, TLooneyView1) THEN
- TLooneyView1(fTrackingView).PlaceLooney(fIconNumber, releasePoint, PlaceIt)
- ELSE IF MEMBER(fTrackingView, TLooneyView2) THEN
- TLooneyView2(fTrackingView).PlaceLooney(fIconNumber, releasePoint, PlaceIt)
-
- END; {TLooneyPlacer.DoIt}
-
-
- {$S ADoCommand}
- PROCEDURE TLooneyPlacer.UndoIt;
- OVERRIDE;
-
- VAR
- releasePoint : VPoint;
-
- BEGIN {TLooneyPlacer.UndoIt}
-
- INHERITED UndoIt;
-
- releasePoint := fReleasePoint;
- IF MEMBER(fTrackingView, TLooneyView1) THEN
- TLooneyView1(fTrackingView).PlaceLooney(fIconNumber, releasePoint, UnPlaceIt)
- ELSE IF MEMBER(fTrackingView, TLooneyView2) THEN
- TLooneyView2(fTrackingView).PlaceLooney(fIconNumber, releasePoint, UnPlaceIt)
-
- END; {TLooneyPlacer.UndoIt}
-
-
- {$S ADoCommand}
- PROCEDURE TLooneyPlacer.RedoIt;
- OVERRIDE;
-
- VAR
- releasePoint : VPoint;
-
- BEGIN {TLooneyPlacer.RedoIt}
-
- INHERITED RedoIt;
-
- releasePoint := fReleasePoint;
- IF MEMBER(fTrackingView, TLooneyView1) THEN
- TLooneyView1(fTrackingView).PlaceLooney(fIconNumber, releasePoint, RePlaceIt)
- ELSE IF MEMBER(fTrackingView, TLooneyView2) THEN
- TLooneyView2(fTrackingView).PlaceLooney(fIconNumber, releasePoint, RePlaceIt)
-
- END; {TLooneyPlacer.RedoIt}
-
-